package lab02.test11;

import com.sun.org.apache.xpath.internal.SourceTree;

/**
 * Created by Administrator on 2017/10/23.
 */
public class Rectangle implements Printx {
    //属性：边长（长、宽）
    double longth;
    double width;
    //行为：求面积、求周长
    double area(){return longth*width;}
    double perimeter(){return (longth+width)*2;}



    @Override
    public void printMyWay() {
        System.out.println(longth);
        System.out.println(width);
        System.out.println(area());
        System.out.println(perimeter());

    }
}
